<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.lp.cfg.ProConfig" %>
<!DOCTYPE html>
<html>
<head>
	<%@ include  file="/WEB-INF/oss/base/common/variable.jsp"%>
    <%@ include  file="/WEB-INF/oss/base/common/resource_lib.jsp"%>
    <%@ include  file="/WEB-INF/oss/base/common/variable_js.jsp"%>
    <script type="text/javascript" src="<%=basePath%>/lib/webUploader/webuploader.min.js"></script>	 
	<style type="text/css">
		.self-base-icon{
			padding: 0 10px;
			font-size: 14px;
			cursor: pointer;
		}
		.self-base-icon:HOVER {
			color: #00aaee;
		}
		.span-name{
			display: inline-block;
			width: 70px;
			
		}
		.webuploader-element-invisible{
			display: none !important;
		}
	</style>
</head>
<body>
	<div class="app-container">
		
		<div class="clearfloat container">
			
		</div>
	</div>
	<div id="template1" class="hide">
		<div style="text-align: left; width: 25%;float:left;padding: 10px 0;">
			<p style="font-size: 16px;">Company Name:<span style="color:red;font-size: 16px;">{0}</span></p>
			<p style="padding-top: 10px; height: 51px;" >
				<img style="width: 41px;height: 41px; margin-left: 50px;" alt="" src="<%=basePath%>/image/oss/iot/{1}.png"> 
			</p>
			<p style="margin: 15px 0;">
				<div class="upload_img mr10" id="upload_img_{1}"  style="display: inline-block;position: relative;width: 100px;">
		        	<button tag="{1}" class="button ml10" style="width: 150px;"><span class="iconfont icon-upload"></span><span> </span>Upload base map</button>
				</div> 
			</p>
		</div>
	</div>
	
	 			
	
</body>
<script type="text/javascript">
	
	// 初始化传感器
	getAjax(localUrl + '/dictionary/20' , function(data){
		if(isOK(data)){
			var dataT =data.data ;
			for(var i=0;i<dataT.length;i++){
				$(".container").append( $("#template1").html().format(dataT[i].name , dataT[i].code   ) );
				imgInit("upload_img_"+  dataT[i].code ,dataT[i].code );
			}
		}
	});
	
	function imgInit(id,code){
		//上传模板
		UploadInit( localUrl + '/sensor/ico/upload.json' , {"code":code} ,function(file,data){
			// 
			if(isOK(data)){
				alert("Upload successfully, due to the existence of cache, the picture will not be refreshed immediately, need to refresh the page several times, thank you!");
				window.location.reload();
			}
		}, id ,"","100px", "35px") ; 
	}
	
	$(function(){
		
		
	})
	
</script>
</html>